UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yo3e0MuVJ/628oVT/iFf1G7OyVQl0BunuXZVkxHi4VA=' 
WHERE 
  key_id = '297de08cbd02478e3ef2db5303d9e30e9f0091c067d43f453560315ce5984f36' 
  AND (
    token = 'yo3e0MuVJ/628oVT/iFf1G7OyVQl0BunuXZVkxHi4VA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019