UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DbJiyHRzYTjAVz/G/vElvHSmai8FVHpqouc9cu4E3rA=' 
WHERE 
  key_id = '371ef552b0780bf3c8dca20a887792dd86700764af0fbd4f04c6f673134ff4d6' 
  AND (
    token = 'DbJiyHRzYTjAVz/G/vElvHSmai8FVHpqouc9cu4E3rA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055