UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f4YbnkT/KqIRLy5WNmOPnxBNbSRY7+07j+VB6yRI+XE=' 
WHERE 
  key_id = '72677c4f90029f7aa2258d67a131b514ccab7706742af21e2713538842e63a3d' 
  AND (
    token = 'f4YbnkT/KqIRLy5WNmOPnxBNbSRY7+07j+VB6yRI+XE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035