UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ioy5E6MwUVgc3LOACpQLm5dw4pjn1/IJ5CIILOXcn4Q='
WHERE
key_id = '98a8ef2863d5203105c2a174c6993d17ffdec7a0a9b9593e971da084f1abeafa'
AND (
token = 'Ioy5E6MwUVgc3LOACpQLm5dw4pjn1/IJ5CIILOXcn4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)