UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dYPmvuXfjzUZHUayK8Ae+uZvMQnDbtR7JI8RgzWLx0=' 
WHERE 
  key_id = '5903aa9d5c675bd2db86b804e87a595113f4f1e18cc9fb8b663a4ac696a5a18b' 
  AND (
    token = '3dYPmvuXfjzUZHUayK8Ae+uZvMQnDbtR7JI8RgzWLx0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034