UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrxqWWqWRELxk65fQPF3JVMWW7Pa7pAWs8YTv5NQz9c='
WHERE
key_id = 'b55622585bba209667a9d62ae1cc84c757f795fdf3911c0c4ef520b5f03a8b6c'
AND (
token = 'CrxqWWqWRELxk65fQPF3JVMWW7Pa7pAWs8YTv5NQz9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)