UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fH/fDmRtR8qqlHSXB9JyUKVLvNQm/qtoSW2tF+KQyJo='
WHERE
key_id = '5a7573aa389cf3cf2307c926987540b6f78ac8ce3677a12673db8fe2b4a58901'
AND (
token = 'fH/fDmRtR8qqlHSXB9JyUKVLvNQm/qtoSW2tF+KQyJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)