UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V7PCUmj05rLBrT8cq1xsCf8h34s0TLvmQ15Cm4D/LBY=' 
WHERE 
  key_id = '4ad9f64e790d1bb82d7e2c0021e44910018ec80f1f8de2e44cc56e7c94a7bcc0' 
  AND (
    token = 'V7PCUmj05rLBrT8cq1xsCf8h34s0TLvmQ15Cm4D/LBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026