UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nJEt6mHBddj1UeuY/Lo/uNs0FUDjbOlX6bk9BIXSt0s='
WHERE
key_id = 'd697b8216953ab0a96b4a6be2d3fa5ee8f48a9d8546b7fc6c4a3dbd7724db2e2'
AND (
token = 'nJEt6mHBddj1UeuY/Lo/uNs0FUDjbOlX6bk9BIXSt0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)