UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/tkZH/6kZLOKDk9nwin1XbDxeMVMRJ91jY+A1WR5CcI=' 
WHERE 
  key_id = 'c7ea1085a592138f69b081ade1aa9b357d2f083d5a3d4a242c2963a6cae460b5' 
  AND (
    token = '/tkZH/6kZLOKDk9nwin1XbDxeMVMRJ91jY+A1WR5CcI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043