UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UBmo+YYx2+QS00ZR1QeW3Pl5E5BxOEUMv7cVd78MIrM='
WHERE
key_id = 'ffae9d6c3a6490c37625f3593914c33b3b13db42ed28d8827cdae5c6f7a3dfb2'
AND (
token = 'UBmo+YYx2+QS00ZR1QeW3Pl5E5BxOEUMv7cVd78MIrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)