UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PfRRROZVMYMXOa+CizhO9GWwMdr6JL1cg2FjoM7Z/oo=' 
WHERE 
  key_id = '45c6060b7f54ae9702e892ccbc47c2daa4b726f885c2c89a9d0a511e4a5ae3ba' 
  AND (
    token = 'PfRRROZVMYMXOa+CizhO9GWwMdr6JL1cg2FjoM7Z/oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053