UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mShC1nq0RkWIn+iPUBXJGG1LEvS1FWii31VFRIhG2Y4=' 
WHERE 
  key_id = 'c06cda64113bd4fa0774951dcba8a457fd79d87abab9c3606575297fb2257ac9' 
  AND (
    token = 'mShC1nq0RkWIn+iPUBXJGG1LEvS1FWii31VFRIhG2Y4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032