UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UNjJyEFkUGKHmkNU+Z8qKZqsJJ1p25/VujdjL/TqVOU='
WHERE
key_id = '1ff12d8e17f4b41caa5ea9193a3cd1d593bbb31740c02ecfb6cd748bf57d0dca'
AND (
token = 'UNjJyEFkUGKHmkNU+Z8qKZqsJJ1p25/VujdjL/TqVOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)