UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4/BhYZJC1l1r1HjnZD4ouGLwrYo0QMxw3DZ19EouTEI=' 
WHERE 
  key_id = 'eded551e55202d150ff7959ac671d9c2d8c363a428b60d41b5dcec3de191be72' 
  AND (
    token = '4/BhYZJC1l1r1HjnZD4ouGLwrYo0QMxw3DZ19EouTEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015