UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VGLPbAkb06poNBxho0qZKXfq1ZzYaHXZMgny2q3IY9E=' 
WHERE 
  key_id = 'd0fadf77761487770aca063f632196c3782f31926009e6fcb716a7b277ccf6ec' 
  AND (
    token = 'VGLPbAkb06poNBxho0qZKXfq1ZzYaHXZMgny2q3IY9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036