UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ph+VamPhLmcRxKDsGfEM2kKDVWLZQwW8i8sSbNzbylg=' 
WHERE 
  key_id = '056e4bcb1bd4c01462cc870db0d2ff2bac236823c1b5432d35e29cb15fbebfd5' 
  AND (
    token = 'Ph+VamPhLmcRxKDsGfEM2kKDVWLZQwW8i8sSbNzbylg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048