UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UL1M/1k9Nx9TWEd2yveeE0MR9aYG/Jbrxz8V53fAws0='
WHERE
key_id = 'e5b0c9e7eb7f28078d64362e354b156625db1bc6c0ca8abfc4f71e10540f23b7'
AND (
token = 'UL1M/1k9Nx9TWEd2yveeE0MR9aYG/Jbrxz8V53fAws0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)