UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wq2qzVqZd/3OZZZ5dbnatjzr2T5eKp+MUtqT+DP39hA=' 
WHERE 
  key_id = '5b88ab02e769dd9edaa4c6579560131f1bf737def051afc1ae28ed0f5517332b' 
  AND (
    token = 'Wq2qzVqZd/3OZZZ5dbnatjzr2T5eKp+MUtqT+DP39hA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027