UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e/T9lXpKEjEIJssaZc7PfCsGj7lWUgAhFjPCcTAabqc='
WHERE
key_id = '1ea93061f041725b7a47386ae05be73f7c83dcf146ccf1e0b416737cada2d79d'
AND (
token = 'e/T9lXpKEjEIJssaZc7PfCsGj7lWUgAhFjPCcTAabqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)