UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aP+WhFpD7nIRcpp59ArR47AysHsDVHril6tbDYu/mMw='
WHERE
key_id = '46ef63b975de59e2eb9faecab89466c466b9252b5e2bd1c37a476d2fce08d45c'
AND (
token = 'aP+WhFpD7nIRcpp59ArR47AysHsDVHril6tbDYu/mMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)