UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VC2UY7STZCHS3Q0zeeuar3u3Tfzeo13aWRVDeYr+PnI=' 
WHERE 
  key_id = '59f0d2e69eb914c28dd30cf0403c12f2966d6d5af488633d2bc09b1a920d96b9' 
  AND (
    token = 'VC2UY7STZCHS3Q0zeeuar3u3Tfzeo13aWRVDeYr+PnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029