UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7GRMuZxXCr+2y3C+bUJmhK1XiBthxkR36nCknSET4o='
WHERE
key_id = '7d13bde51e733aa04af060d46c7cb840f5ab3db71bd07d7868787ad0bb14fdf9'
AND (
token = 'Q7GRMuZxXCr+2y3C+bUJmhK1XiBthxkR36nCknSET4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)