UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F4Zkkz2nxcZjYdCPgwbuHzWeon5RK8+de00K/SM5/ng=' 
WHERE 
  key_id = '3e5dd73d43930d67237822b1b04390a8915f90f8331d4e90a7d628edbc2e1084' 
  AND (
    token = 'F4Zkkz2nxcZjYdCPgwbuHzWeon5RK8+de00K/SM5/ng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020