UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9lEHtVG/F3RmBdAcAR4Fijq2B4Wu13bNhxsVyck5zGY='
WHERE
key_id = '3c1c39c1238d2e7cfaf28b05e78667465caaeef1fdd44d34f193a5af701fa176'
AND (
token = '9lEHtVG/F3RmBdAcAR4Fijq2B4Wu13bNhxsVyck5zGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)