UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DffX4Ee6iFZLESEcYDCq2rqWJaqOC+/Q2croZhObVa4='
WHERE
key_id = '432eec9de3964f223e14ae2bc05edaf14d9e1fdc3be5f65a9bd42b4bace5ffd0'
AND (
token = 'DffX4Ee6iFZLESEcYDCq2rqWJaqOC+/Q2croZhObVa4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)