UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'paubZQ5Y2zvafeJ2Ms8UGGkPkS+SDiJM2fRyeHvR13k=' 
WHERE 
  key_id = '8f4515e4d88e97e918ac02ec9f7f500a74fef815fce1c95f46d578a62c185401' 
  AND (
    token = 'paubZQ5Y2zvafeJ2Ms8UGGkPkS+SDiJM2fRyeHvR13k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036