UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r6FHbAIffKpt6FKEY2U1x4aeSiZkJTK/WfucL0GIQlI=' 
WHERE 
  key_id = '1875dbdcf6962a4c9f4441d9f888d1253d8933f0fb845f5a25ebf9fff29b75d9' 
  AND (
    token = 'r6FHbAIffKpt6FKEY2U1x4aeSiZkJTK/WfucL0GIQlI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028