UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N7kJvRprnnfjDgg0UG3rNetgN5H8/uaeVYOzw4n95JU='
WHERE
key_id = '96ff9e804e0d5500ad1e54341ff3eb1d9e258b1ec55025e0152bc9b8003b7443'
AND (
token = 'N7kJvRprnnfjDgg0UG3rNetgN5H8/uaeVYOzw4n95JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)