UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4dIcrAKrMIiILBou/nLcy9738/YBRtIRxuVjURSyG1I=' 
WHERE 
  key_id = '2eb3284e1264351ddd2098530365cb42f8732fefd6687ae7fc7ddba89555c81c' 
  AND (
    token = '4dIcrAKrMIiILBou/nLcy9738/YBRtIRxuVjURSyG1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035