UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hjwcriLNd3KetCPH3YtluyVxqyE+hFjph1i+m1IIy+E='
WHERE
key_id = '1a3dd723412808f0d030d61a5dea1ad7ab3df834b405fc453c6d3489e5e7b975'
AND (
token = 'hjwcriLNd3KetCPH3YtluyVxqyE+hFjph1i+m1IIy+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)