UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j+FP5ZB66dSi0LwEfLx1yxfQOVOh2WF8HucSyjuAeB8=' 
WHERE 
  key_id = 'a994e6a7c315ab999cf30ac01ab9d649c66b753f7cbac3a30fae2bcf5d08f05f' 
  AND (
    token = 'j+FP5ZB66dSi0LwEfLx1yxfQOVOh2WF8HucSyjuAeB8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033