UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HcrRLAR0wwMMicvP0j+FtozCzRLC1RssclKual+yJco=' 
WHERE 
  key_id = '9b9f36aeb18a3d973f65433386aa728ba3bae04b529eb0a8ec5c0668e0c5fbbf' 
  AND (
    token = 'HcrRLAR0wwMMicvP0j+FtozCzRLC1RssclKual+yJco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051