UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3exbsKmHzlFN2EyY7EESaHVeZ0T+cWldQ3KsfqaLmU='
WHERE
key_id = '14442244d2ad3b274d88a375b34cf152db5d912f3b9b5dc7b86640c69384e4ac'
AND (
token = 'E3exbsKmHzlFN2EyY7EESaHVeZ0T+cWldQ3KsfqaLmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)