UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5TZVZ408Fx1xp6/XIIKohGLbdg5pB1iXlFSNqJWYhD0=' 
WHERE 
  key_id = '5fb4290e17fa432b0a321a1e89a054f2890e56c8e5b39838475e8cc45eadd917' 
  AND (
    token = '5TZVZ408Fx1xp6/XIIKohGLbdg5pB1iXlFSNqJWYhD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020