UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bKNG1WH7GqQUVdAnAiPYBkKpb5zd0ZtyjvHYVXPL9Zg='
WHERE
key_id = '34d36303188aecf92fea953f90de591e1a00ddf74410bab3cb385773d7b7f6ff'
AND (
token = 'bKNG1WH7GqQUVdAnAiPYBkKpb5zd0ZtyjvHYVXPL9Zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)