UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CO1h9pwK2H18Ig5HEvM8uuPQLLvF8e4NH4MVZKuf93M='
WHERE
key_id = '9a19cabea52b47769891b7b052aa547f6ef091ebfb2f52a526d6bc7cf1d330db'
AND (
token = 'CO1h9pwK2H18Ig5HEvM8uuPQLLvF8e4NH4MVZKuf93M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)