UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZuYqdwDc4FognbP99bXmmsmimQCpgnGP+NZUzKG7DU='
WHERE
key_id = '677c97a2c9d9080bda9efbc2e2f68457e65401e5ee25d82e74ce06a45124201c'
AND (
token = 'DZuYqdwDc4FognbP99bXmmsmimQCpgnGP+NZUzKG7DU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)