UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EPUw0Qltr+NOBoSdfC3HyI3Be11at22sFAW8aIFWBGI='
WHERE
key_id = '800e66399e74dd001acdd0e26e9a8ad533198ab4cf238028528c0b36a79fc244'
AND (
token = 'EPUw0Qltr+NOBoSdfC3HyI3Be11at22sFAW8aIFWBGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)