UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2nxf5s+iEIAWkx6s04uX0uQ8iSsK6DYeXF1diKzJ/TQ='
WHERE
key_id = '5c0afdfa6fa6710d6d150e2f6dec517b71e43086224b78daab66cd0abb0c94ee'
AND (
token = '2nxf5s+iEIAWkx6s04uX0uQ8iSsK6DYeXF1diKzJ/TQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)