UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwaa6CvczOp8KFtg078Id7RJgIHQ+qsqwLc6HZmFEds='
WHERE
key_id = 'a2b26cca37225886d0390e67567245dcbb6423ed8e5dd84a08fb5b24e1ff56ad'
AND (
token = 'fwaa6CvczOp8KFtg078Id7RJgIHQ+qsqwLc6HZmFEds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)