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

Query time 0.00050