UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBvobxS3SW6YOBbww0XKNYNcbIIeyMsR1uC9h8rgJ9E='
WHERE
key_id = '51a18f8cb671b5794deb12b8151593154b2f35d9fb8b02fe02fe1da8649f3d6d'
AND (
token = 'WBvobxS3SW6YOBbww0XKNYNcbIIeyMsR1uC9h8rgJ9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)