UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Glic/XnUZQwf1MvwwCsw/wFZhEeGctUvC9jW4xG+NgQ='
WHERE
key_id = '7e96db1e32a2727f643cab155fbd05174eb12e39ec852b1ffa271d3c92d269ed'
AND (
token = 'Glic/XnUZQwf1MvwwCsw/wFZhEeGctUvC9jW4xG+NgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)