UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2x2n10jH1KBt0h/M/yp3favKU58X7m1xnSprw32D1is=' 
WHERE 
  key_id = '4555ae647ab603bc26519d08e96a473b63d863fd378172271b657ca3fe552d9e' 
  AND (
    token = '2x2n10jH1KBt0h/M/yp3favKU58X7m1xnSprw32D1is=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053