UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ORXyVz9D8ugEHfJfTNpI68Lg8KSPhxSoP6i4kxche7w='
WHERE
key_id = '067a8826eebdf14366f92913c6281496c008faa1c4915886999af04a073c7d18'
AND (
token = 'ORXyVz9D8ugEHfJfTNpI68Lg8KSPhxSoP6i4kxche7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)